using Microsoft.AspNetCore.Http;
using System.ComponentModel.DataAnnotations;

namespace UniversalAdmin.Application.DTOs;

public class DocumentUploadDto
{
    [Required(ErrorMessage = "标题是必填项")]
    [StringLength(200, ErrorMessage = "标题长度不能超过200个字符")]
    public string Title { get; set; } = string.Empty;

    public string? Content { get; set; }

    public IFormFile? File { get; set; }

    [StringLength(500, ErrorMessage = "来源长度不能超过500个字符")]
    public string? Source { get; set; }
}

public class DocumentResponseDto
{
    public Guid Id { get; set; }
    public string Title { get; set; } = string.Empty;
    public string Content { get; set; } = string.Empty;
    public string Source { get; set; } = string.Empty;
    public string? ErrorMessage { get; set; }
    public Guid UploadedBy { get; set; }
    public string? Summary { get; set; }
    public DateTime CreatedAt { get; set; }
    public DateTime UpdatedAt { get; set; }
    public int ChunksCount { get; set; }
}

public class DocumentDto
{
    public Guid Id { get; set; }
    public string Title { get; set; } = string.Empty;
    public string Content { get; set; } = string.Empty;
    public string Source { get; set; } = string.Empty;
    public string? ErrorMessage { get; set; }
    public Guid UploadedBy { get; set; }
    public string? Summary { get; set; }
    public DateTime CreatedAt { get; set; }
    public DateTime UpdatedAt { get; set; }
    public int ChunksCount { get; set; }
}

public class DocumentChunkDto
{
    public Guid Id { get; set; }
    public Guid DocumentId { get; set; }
    public string Content { get; set; } = string.Empty;
    public float[] Embedding { get; set; } = Array.Empty<float>();
    public DateTime CreatedAt { get; set; }
    public DateTime UpdatedAt { get; set; }
}